<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
	<head>
      <link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
      <link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
      <style>
      *{
        <#if .locale == "zh_CN">
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        <#elseif .locale == "zh_TW">
        font-family: NotoSans, NotoSansCJKtc, sans-serif;
        <#elseif .locale == "ja_JP">
        font-family: NotoSans, NotoSansCJKjp, sans-serif;
        <#elseif .locale == "ko_KR">
        font-family: NotoSans, NotoSansCJKkr, sans-serif;
        <#elseif .locale == "th_TH">
        font-family: NotoSans, NotoSansThai, sans-serif;
        <#else>
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        </#if>
      }
      body {
        width: 21.5cm;
        height: 14cm;
        margin: 0;
        padding: 0;
        background-color: #FFFFFF;
        text-align: center;
      }
      table {
        table-layout:fixed;
        margin: -10px 12px 0 2px;
      }
      table td {
        font-size: 15px;
        text-align: center;
        word-wrap: break-word;
         word-break: break-all;
      }
      table td p {
        width: 100%;
        /*height: auto;*/
        color: #000;
        word-wrap: break-word;
        word-break: break-all;
      }
      table td  {
        height: 20px;
      }
      table .td1 {
        width: 4%;
      }
      table .td2 {
        width: 6%;
      }
      table .td3 {
        width: 8%;
      }
      table .td4 {
        width: 6%;
      }
      table .td5 {
        width: 6%;
      }
      table .td6 {
        width: 4%;
      }
      table .td7 {
        width: 4%;
      }
      table .td8 {
        width: 4%;
      }
      table .td9 {
        width: 4%;
      }
      table .td10 {
        width: 4%;
      }
      table .td11 {
        width: 4%;
      }
      table .td12 {
        width: 6%;
      }
      table .td13 {
        width: 4%;
      }
      table .td14 {
        width: 4%;
      }
      table .td15 {
        width: 4%;
      }
      table .td16 {
        width: 4%;
      }
      table .td17 {
        width: 6%;
      }
      table .td18 {
        width: 6%;
      }
      table .td19 {
        width: 6%;
      }
      table .td20 {
        width: 6%;
      }
      .leftBorder {
        border-left: 1px solid #000000;
      }
      .rightBorder {
        border-right: 1px solid #000000;
      }
      .topBorder {
        border-top: 1px solid #000000;
      }
      .bottomBorder {
        border-bottom: 1px solid #000000;
      }
      .border {
        border: 1px solid #000000;
      }
    </style>
	</head>
	<body>
    <#assign pageSize=((po.items?size)/5)?ceiling ?number>

    <#list 1..pageSize as i>
    <#if i <= pageSize >
    <div style="height:100%">
    <table cellspacing="0" cellpadding="0" width="100%">
      <tr>
        <td  class="td1"></td>
        <td  class="td2"></td>
        <td  class="td3"></td>
        <td  class="td4"></td>
        <td  class="td5"></td>
        <td  class="td6"></td>
        <td  class="td7"></td>
        <td  class="td8"></td>
        <td  class="td9"></td>
        <td  class="td10"></td>
        <td  class="td11"></td>
        <td  class="td12"></td>
        <td  class="td13"></td>
        <td  class="td14"></td>
        <td  class="td15"></td>
        <td  class="td16"></td>
        <td  class="td17"></td>
        <td  class="td18"></td>
        <td  class="td19"></td>
        <td  class="td20"></td>
      </tr>
      <tr>
        <td colspan="20">
          <p style="text-align: center;font-size: 30px;font-weight: 600;line-height: 30px;">
            采购订单
          </p>
        </td>
      </tr>
      <tr>
        <td colspan="10">
          <p style="text-align: left;font-size:  12px;line-height:15px;">
            采购单位：<span style="font-size: 14px;line-height: 15px; text-decoration: underline;">${po.subsidiary}</span>
          </p>
          <p style="text-align: left;font-size:  12px;line-height:15px;">
            采购合同号：<span style="font-size: 14px;line-height: 15px; text-decoration: underline;">${po.contractno}</span>
          </p>
          <p style="text-align: left;font-size:  12px;line-height:15px;">
            供应商单位：<span style="font-size:  12px;line-height: 15px; text-decoration: underline;">${po.vendor}</span>
          </p>
        </td>
        <td colspan="10">
          <p style="text-align: right;font-size:  12px;line-height:15px;">
            NO：${po.tranid}
          </p>
          <p style="text-align: right;font-size:  12px;line-height:15px;">
            日期：${po.date}
          </p>
          <p style="text-align: right;font-size:  12px;line-height:15px;">
            币种：<span style="font-size:  12px;line-height: 15px; text-decoration: underline;">${po.currency}</span>
          </p>
        </td>
      </tr>
      <tr>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">序号</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">SKU</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">中文名称</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">物料编码</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">规格</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">颜色</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">色号</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">花型</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">花型号</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">采购数量</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">采购单位</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">未税单价(采购单价计量)</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">换算系数</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">换算数量</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">换算计量单位</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">汇率</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">未税金额</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">含税金额</p>
        </td>
        <td class=" leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">交货日期</p>
        </td>
        <td class=" leftBorder topBorder rightBorder  ">
          <p style="text-align: center;font-size:  8px;font-weight: 600;  ">备注</p>
        </td>
      </tr>
      <#assign totalQty=0?number>
      <#assign totalAmount=0?number>
      <#assign totalGrossAmount=0?number>
      <#list po.items as item>
      <#if (item_index+1) gt 5*(i-1) && (item_index+1) lte 5*i>
      <#assign totalQty = totalQty+item.quantity?number>
      <#assign totalAmount = totalAmount+item.amount?number>
      <#assign totalGrossAmount = totalGrossAmount+item.grossAmount?number>
      <tr>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.lineNumber}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.sku}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.name}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.code}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.size}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.color}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.colorNumber}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.flowerType}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.flowerTypeColor}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.quantity}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.unit}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.rate}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${po.exchangerate}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.amount}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.grossAmount}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.deliveryDate}</p>
        </td>
        <td class="leftBorder topBorder rightBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${item.remarks}</p>
        </td>
      </tr>
    </#if>
    </#list>

    <#if i=pageSize && (po.items?size)%5 != 0>
    <#list 1..(5-((po.items?size)%5)) as j>
    <#if j <= (5-((po.items?size)%5)) >
      <tr>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 8px;">${po.items?size + j}</p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder   ">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder  ">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
      </tr>
</#if>
</#list>
</#if>
      <tr>
        <td class="leftBorder topBorder" colspan="3">
          <p style="text-align: center;font-size:  10px;">小计：</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  10px;">${totalQty}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  10px;">${totalAmount}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  10px;">${totalGrossAmount}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder" colspan="3">
          <p style="text-align: center;font-size:  10px;">总计：</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  10px;">${po.totalQuantity}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  10px;">${po.totalAmount}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  10px;">${po.totalGrossAmount}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size:  8px;line-height: 16px;"></p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder rightBorder" colspan="20">
          <table style="width: 100%;margin: 0;">
            <tr>
              <td style="width: 6%;">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">总计:</p>
              </td>
              <td style="width: 10%;">
                <p style="text-align:left;font-size:  12px;line-height: 16px;">原币:</p>
              </td>
              <td style="width: 25%;">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">未税金额:${po.currency}${po.totalAmount}</p>
              </td>
              <td style="width: 25%;">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">税额:${po.currency}${po.totalTaxAmount} </p>
              </td>
              <td style="width: 34%;">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">含税金额:${po.currency}${po.totalGrossAmount}</p>
              </td>
            </tr>
            <tr>
              <td style="width: 6%;">
                <p style="text-align:left;font-size:  12px;line-height: 16px;"></p>
              </td>
              <td style="width: 10%;">
                <p style="text-align:left;font-size:  12px;line-height: 16px;">本位币:</p>
              </td>
              <td style="width: 25%;">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">未税金额:${po.baseCurrency}${po.baseCurrencyTotalAmount}</p>
              </td>
              <td style="width: 25%;">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">税额:${po.baseCurrency}${po.baseCurrencytotalTaxAmount}</p>
              </td>
              <td style="width: 34%;">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">含税金额:${po.baseCurrency}${po.baseCurrencyTotalGrossAmount}</p>
              </td>
            </tr>
          </table>
        </td>
      </tr>
<tr>
  <td class="leftBorder topBorder rightBorder" colspan="20">
    <p style="width: 100%;text-align: right;font-size: 14px;line-height: 16px;">打印次数：${po.printTimes} 次</p>
  </td>
</tr>
      <tr>
        <td class="leftBorder topBorder bottomBorder" colspan="16">
          <table style="width: 100%;margin: 0;">
            <tr>
              <td colspan="4">
                <p style="text-align:left;font-size:  12px;line-height: 14px;">备注:${po.memo}</p>
              </td>
            </tr>
            <tr>
              <td>
                <p style="text-align:left;font-size:  12px;line-height: 14px;">制表人:</p>
              </td>
              <td>
                <p style="text-align:left;font-size:  12px;line-height: 14px;">业务员:</p>
              </td>
              <td>
                <p style="text-align:left;font-size:  12px;line-height: 14px;">核准部门主管:</p>
              </td>
              <td>
                <p style="text-align:left;font-size:  12px;line-height: 14px;">核准财务:</p>
              </td>
            </tr>
          </table>
        </td>
        <td class="leftBorder topBorder rightBorder bottomBorder" colspan="4">
          <p style="text-align: left;font-size:  12px;height: 12px;line-height: 12px;" >采购国家:${po.purchaseCountry}</p>
          <p style="text-align: left;font-size:  12px;height: 12px;line-height: 12px;">运输方式:${po.shipmethod}</p>
          <p style="text-align: left;font-size:  12px;height: 12px;line-height: 12px;">送货地址:${po.address}</p>
        </td>
      </tr>
      <tr>
        <td colspan="20">
          <p style="text-align: left;font-size:  12px;line-height: 14px;">
            一式三联：第一联（白）：存根联；第二联（蓝）：会计记账；第三联（黄）：供应商留存联；
          </p>
        </td>
      </tr>
<tr>
  <td colspan="20">
    <p style="text-align: center;font-size:  12px;line-height: 16px;">
         ${i} / ${pageSize}
    </p>
  </td>
</tr>
    </table>
</div>
</#if>
</#list>
	</body>
</pdf>